package com.common.action;

import java.util.List;
import java.util.Map;

import com.common.bean.Personnel;
import com.common.util.StringToken;

//import com.common.Usertable;
//import com.common.util.StringToken;

public class HomeAction extends AbstractCommonAction {

	private static final long serialVersionUID = 1L;
	
	private Personnel personnel;
	private List<Map> menus;

	// 显示登陆后的首页
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	// 根据登陆用户的类型与权限取得菜单
	@SuppressWarnings("unchecked")
	public String showMenu() throws Exception {
		menus = commonService.findMenu("");
		return SUCCESS;
	}

	// 获取欢迎信息
	public String welcome() throws Exception {
		Object obj = getSession().get(StringToken.CURRENT_LOGIN);
		if (obj instanceof Personnel) {
			personnel = (Personnel) obj;
		}
		return SUCCESS;
	}

	/**
	 * @return the menus
	 */
	public List<Map> getMenus() {
		return menus;
	}

	/**
	 * @param menus the menus to set
	 */
	public void setMenus(List<Map> menus) {
		this.menus = menus;
	}

	/**
	 * @return the personnel
	 */
	public Personnel getPersonnel() {
		return personnel;
	}

	/**
	 * @param personnel the personnel to set
	 */
	public void setPersonnel(Personnel personnel) {
		this.personnel = personnel;
	}

}
